package com.catt.orderdinner.controller;

import com.catt.orderdinner.dataobject.TbFood;
import com.catt.orderdinner.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@RequestMapping("/food")
@ResponseBody
@Controller
public class FoodController  {

    @Autowired
    private FoodService foodService;
    @RequestMapping("list")
    public List<TbFood> list(){
        List<TbFood> all = foodService.findAll();
        return all;
    }
}
